{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "38a48d2f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the role is user\n"
     ]
    }
   ],
   "source": [
    "type = \"system\"\n",
    "role = \"user\" if type in {\"system\", \"assisant\"} else type\n",
    "print(f\"the role is {role}\")\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "9327d01c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "yes\n",
      "is str\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'my name is bao'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d1 = {}\n",
    "if isinstance(d1, dict) and True:\n",
    "    print(\"yes\")\n",
    "elif d1.len == 10 :\n",
    "    print(\"10\")\n",
    "else:\n",
    "    print(\"no\")\n",
    "\n",
    "introduce = \"my name is {name}\"\n",
    "if isinstance(introduce, str):\n",
    "    print(\"is str\")\n",
    "introduce.format(name = \"bao\")\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
